package com.sxz.mall.mallseckill.schedul;

import com.sxz.mall.mallseckill.service.SeckillService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class SeckillSkuSchedule {

    @Autowired
    private SeckillService seckillService;

    // cron表达式表示具体的定时时间
    @Scheduled(cron = "0/10 * * * * ?") // 每天凌晨2点
    public void uploadSeckillSku3Days(){
//        seckillService.uploadSeckillSku3Days();
        System.out.println("定时执行的任务，每10s执行");
    }
}
